package com.ruoyi.business.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.OfficeBuildingRentMapper;
import com.ruoyi.business.domain.OfficeBuildingRent;
import com.ruoyi.business.service.IOfficeBuildingRentService;

/**
 * 写字楼出租Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-12
 */
@Service
public class OfficeBuildingRentServiceImpl implements IOfficeBuildingRentService 
{
    @Autowired
    private OfficeBuildingRentMapper officeBuildingRentMapper;

    /**
     * 查询写字楼出租
     * 
     * @param id 写字楼出租主键
     * @return 写字楼出租
     */
    @Override
    public OfficeBuildingRent selectOfficeBuildingRentById(Long id)
    {
        return officeBuildingRentMapper.selectOfficeBuildingRentById(id);
    }

    /**
     * 查询写字楼出租列表
     * 
     * @param officeBuildingRent 写字楼出租
     * @return 写字楼出租
     */
    @Override
    public List<OfficeBuildingRent> selectOfficeBuildingRentList(OfficeBuildingRent officeBuildingRent)
    {
        return officeBuildingRentMapper.selectOfficeBuildingRentList(officeBuildingRent);
    }

    /**
     * 新增写字楼出租
     * 
     * @param officeBuildingRent 写字楼出租
     * @return 结果
     */
    @Override
    public int insertOfficeBuildingRent(OfficeBuildingRent officeBuildingRent)
    {
        officeBuildingRent.setCreateTime(DateUtils.getNowDate());
        return officeBuildingRentMapper.insertOfficeBuildingRent(officeBuildingRent);
    }

    /**
     * 修改写字楼出租
     * 
     * @param officeBuildingRent 写字楼出租
     * @return 结果
     */
    @Override
    public int updateOfficeBuildingRent(OfficeBuildingRent officeBuildingRent)
    {
        officeBuildingRent.setUpdateTime(DateUtils.getNowDate());
        return officeBuildingRentMapper.updateOfficeBuildingRent(officeBuildingRent);
    }

    /**
     * 批量删除写字楼出租
     * 
     * @param ids 需要删除的写字楼出租主键
     * @return 结果
     */
    @Override
    public int deleteOfficeBuildingRentByIds(Long[] ids)
    {
        return officeBuildingRentMapper.deleteOfficeBuildingRentByIds(ids);
    }

    /**
     * 删除写字楼出租信息
     * 
     * @param id 写字楼出租主键
     * @return 结果
     */
    @Override
    public int deleteOfficeBuildingRentById(Long id)
    {
        return officeBuildingRentMapper.deleteOfficeBuildingRentById(id);
    }
}
